package com.example.maxboxtwo.components.activities;

import android.os.Build;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;

import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import com.example.maxboxtwo.R;
import com.example.maxboxtwo.utils.listeners.LightListener;

import java.util.List;

public class LightActivity extends AppCompatActivity {
    private LightListener lightListener;
    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.light_activity);
        ImageView imageView = findViewById(R.id.light);
        lightListener = new LightListener(imageView,this);
        Button button = findViewById(R.id.onOff);
        button.setOnClickListener(lightListener);
    }

    @Override
    protected void onStart() {
        super.onStart();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    @Override
    protected void onDestroy() {
        super.onDestroy();
        lightListener.closeLight();
    }
}
